/* 01_AnalyzePooledPrecinctData
  Analysis file for 
  Hill, Seth J., Daniel J. Hopkins, and Gregory A. Huber. 2021. "Not by Turnout Alone: Measuring the Sources of Electoral Change, 2012 to 2016." Science Advances.
*/
capture log close
log using CompositionVersusConversion.txt, text replace

use "PooledPrecinctAnalysisData.dta", clear

* Global options.
global OUTREG2OPTIONS tex(fragment) sdec(2) 2aster auto(2) rdec(3) label
global OUTREG1OPTIONS se bracket rdec(3) 3aster 
global TABLELOC "."
** Trim largest/smaller precincts for OLS analysis.
global TRIMPRECINCTS 0

******************
* SUMMARY STATS TABLES 1 AND 3.
******************
do "Tables1And3.do"

******************
* REGRESSION ANALYSIS BY STATE, TABLES 2 AND 4.
******************
do "Tables2And4.do"


log close
